﻿<%@ Control Language="C#" %>
<%@ Register Src="../module/Admincenter-Product-Shopping-Cart-List.ascx" TagName="ShoppingCartList" TagPrefix="inal" %>
<%@ Register src="../module/Types.ascx" tagname="Types" tagprefix="inal" %>
<script runat="server">
    private int Item_Lang = 1;
    private Boolean isMulti = true;
    protected void Page_Load(object sender, EventArgs e)
    {
        Item_Lang = Utils.GetQueryString("lang", 1);
        int item_id = Utils.GetQueryString("id", 0);
        int list_status = Utils.GetQueryString("cid", 0);
        Bills bill = new Bills();
        if (isMulti)
            Repeater_List.DataSource = bill.List(Item_Lang, 100, list_status);
        else
            Repeater_List.DataSource = bill.List(Item_Lang, item_id); 
        Repeater_List.DataBind();
    }
    public Boolean IsMulti
    {
        get { return isMulti; }
        set { isMulti = value; }
    }
</script>
<asp:Repeater runat="server" ID="Repeater_List">
    <ItemTemplate>
        <div id="TR<%#Eval("Bill_Id") %>" class="bill_item">
            <h5><%=Lang.Show("BillId") %> :  <%#Eval("Bill_Id") %></h5>
            <table>
                <tr>
                    <td><%=Lang.Show("BillInquiryId") %> : </td>
                    <td><code><%#Eval("Bill_Inquiry_Id") %></code></td>
                    <td><%=Lang.Show("Published") %> :</td>
                    <td class="tc"><time><%#Eval("Bill_Create_Time") %></time></td>
                </tr>
                <tr>
                    <td><%=Lang.Show("UserName") %> :</td>
                    <td class="user_name"><%#Eval("Bill_User_Name") %></td>
                    <td><%=Lang.Show("UserPhone") %> : </td>
                    <td class="tc user_phone"><code class="user_phone"><%#Eval("Bill_User_Phone") %></code></td>
                </tr>
                <tr>
                    <td><%=Lang.Show("Item_Price") %> ( <%=Lang.Show("RMB") %> ) : </td>
                    <td class="tc"><code class="all_price"><%#Eval("Bill_Price","{0:0.00}") %></code>  </td>
                    <td></td>
                    <td></td>
                </tr>

                <tr>
                    <td ><%=Lang.Show("Address") %> : </td>
                    <td colspan="3" class="user_address"><%#Eval("Bill_User_Address") %></td>
                </tr>
                <tr>
                    <td ><%=Lang.Show("SendShops") %> : </td>
                    <td colspan="3" class="agents" title="<%#Eval("Bill_SendShops") %>"><%#Eval("Agent_Address") %>  <br />  <code>[<%#Eval("Agent_Tel") %>]</code> (<%#Eval("Agent_Name") %>)</td>
                </tr>
                <tr class="work_flow">
                    <td ><%=Lang.Show("Workflow") %> : </td>
                    <td colspan="3" class="work_flow"><inal:Types runat="server" Type="14" /></td>
                </tr>
                <tr>
                    <td colspan="4" id="ShoppingCartList" data-item_list="<%#Eval("Bill_Product_List") %>" data-count_list="<%#Eval("Bill_Count_List") %>">
                        <inal:ShoppingCartList runat="server" Bill_Id='<%#Utils.ToInt(Container.DataItem,"Bill_Id") %>' Shopping_Cart_List='<%#Eval("Bill_Product_List") %>' />
                        <button  class="add">+</button>
                        <div class="add_produc_area"></div>
                    </td>
                </tr>
            </table>
            <%if (IsMulti) {%>
            <div class="btns">
                <a href="javascript:Del(<%#Eval("Bill_Id") %>,14)" class="del"><%=Lang.Show("Del")%></a>
                <a href="javascript:SendToPrint(<%#Eval("Bill_Id") %>)"><%=Lang.Show("Print")%></a>
                <a href="javascript:BillShowEditMode(<%#Eval("Bill_Id") %>)" class="edit" ><%=Lang.Show("Edit")%></a>
                <a href="javascript:SaveBillItems(<%#Eval("Bill_Id") %>)" class="blue hide save"><%=Lang.Show("Save")%></a>
                <a href="javascript:BillReset(<%#Eval("Bill_Id") %>)" class="blue hide reset"><%=Lang.Show("Reset")%></a>
            </div>
            <%} %>
            <script type="text/javascript">
                var count_lists = '<%#Eval("Bill_Count_List") %>'.split(',');
                var item_temp_lists = '<%#Eval("Bill_Product_List") %>'.split(',');
                for (var i in item_temp_lists) {
                   
                    $("#Bills div#TR<%#Eval("Bill_Id") %> li.li" + item_temp_lists[i] + " code.count").html(count_lists[i])
                    
                }
            </script>
        </div>
    </ItemTemplate>
</asp:Repeater>

